package com.bringspring.files.utils;

public class FileStorageUtil {
//    public static MimeType getMimeType(final InputStream in, final String fileName) {
//        CompositeDetector detector = new CompositeDetector(Collections.singletonList(MimeTypes.getDefaultMimeTypes()));
//        try {
//            Metadata metadata = new Metadata();
//            metadata.add(Metadata.RESOURCE_NAME_KEY, fileName);
//            TikaInputStream inputStream = TikaInputStream.get(in);
//            MediaType mediaType = detector.detect(inputStream, metadata);
//            MimeTypes allTypes = MimeTypes.getDefaultMimeTypes();
//            return allTypes.forName(mediaType.toString());
//        } catch (IOException | MimeTypeException e) {
//            log.error("Detect file {} mimeType err : {}", fileName, e.getMessage());
//        }
//        return null;
//    }
}
